package de.uni_mannheim.informatik.ai.dame_ai.util;

import java.awt.FlowLayout;
import java.awt.GridLayout;
import java.awt.Window;
import javax.swing.JLabel;
import javax.swing.JPanel;


/**
 * A simple Modal Dialog.
 * @author Martin Boelle
 *
 */
@SuppressWarnings("serial")
public abstract class PopupDialog extends ModalDialog {
	protected static final int WIDTH=400;
	protected static final int HEIGHT=160;
	protected JPanel rootPan=new JPanel(new GridLayout(2, 1));
	protected JPanel butPan=new JPanel();
	protected JLabel questLab;
	protected static final int MIN_BUTTON_WIDTH=100;
	
	/**
	 * @param owner The owner of the dialog. He will be disabled until the user responds.
	 * @param title The title for the dialog frame.
	 * @param text The text that will be displayed to the user inside of the dialog frame.
	 */
	public PopupDialog(Window owner, String title, String text) {
		super(owner, title, WIDTH, HEIGHT);
		questLab = new JLabel("   "+text);
		rootPan.add(new JPanel(new FlowLayout()).add(questLab));
		rootPan.add(butPan);
		this.add(rootPan);
	}
}
